package oct2013;

public class RemoveDuplicatesfromSortedArray {
	public int removeDuplicates(int[] A) {
		int n = A.length;
		int i = 0, j = 0;
		while (j < n) {
			A[i++] = A[j++];
			while (j < n && A[j] == A[j - 1])
				j++;
		}
		return i;
	}
}
